{% extends 'admin-v2/layout.html.twig' %}
{% import 'admin-v2/macro.html.twig' as admin_macro %}

{% set menu = 'admin_v2_destroyed_account_manage' %}

{% block main %}
  <form id="record-form" class="form-inline well well-sm" action="{{ path('admin_v2_destroyed_account') }}" method="get" novalidate>
    <div class="form-group">
      <select id="keywordType" name="keywordType" class="form-control">
        <option value="id" {% if app.request.query.get('keywordType') == 'id' %}selected{% endif %}>{{'admin_v2.destroy_account.destroyed_account.number'|trans}}</option>
        <option value="nickname" {% if app.request.query.get('keywordType') == 'nickname' %}selected{% endif %}>{{'form.placeholder.nickname'|trans}}</option>
      </select>
    </div>

    <div class="form-group">
      <input type="text" id="keyword" name="keyword" class="form-control" value="{{ app.request.query.get('keyword') }}"
             placeholder="{{ 'form.placeholder.search_keyword'|trans }}">
    </div>
    <button class="btn btn-primary">{{ 'form.btn.search'|trans }}</button>
  </form>

  <table class="table table-hover table-striped" id="record-table">
    <thead>
    <tr>
      <th>{{'admin_v2.destroy_account.destroyed_account.number'|trans}}</th>
      <th>{{'admin_v2.destroy_account.destroyed_account.nickname'|trans}}</th>
      <th>{{'admin_v2.destroy_account.destroyed_account.destroy_time'|trans}}</th>
      <th>{{'admin_v2.destroy_account.destroyed_account.operation'|trans}}</th>
    </tr>
    </thead>
    <tbody>
    {% if destroyedAccounts %}
      {% for destroyedAccount in destroyedAccounts %}
        <tr>
          <td>
            {{ destroyedAccount.id }}
          </td>
          <td>
            {{ destroyedAccount.nickname }}
          </td>
          <td>
            {{ destroyedAccount.time|date('Y-m-d H:i:s') }}
          </td>
          <td>
            <a href="javascript:" data-role="edit-item" data-url="{{ path('admin_v2_destroyed_account_detail', {id: destroyedAccount.id}) }}" data-toggle="modal" data-target="#modal">{{'form.btn.view'|trans}}</a>
          </td>
        </tr>
      {% endfor %}
    {% else %}
      <tr><td colspan="20"><div class="empty">{{'admin_v2.destroy_account.destroyed_account.empty'|trans}}</div></td></tr>
    {% endif %}
    </tbody>
  </table>
  {{ admin_macro.paginator(paginator) }}
{% endblock %}